home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Demos / A.D. Software / OOFILE / OOFILE AppMaker / FileAndFind / Pre-built version, as generated / CAboutDialog.cp < prev    next >
Text File  |  1995-09-30  |  3KB  |  156 lines

  1.     // CAboutDialog.cp -- dialog methods
  2.     // Created 01/01/95 12:01 PM by AppMaker
  3.  
  4.     #include "CAboutDialog.h"
  5.  
  6.  
  7.     #include <UReanimator.h>
  8.     #include <LStream.h>
  9.     #include <LStdControl.h>
  10.     #include <PP_Messages.h>
  11.  
  12.     #define PPob_AboutDialogID    201
  13.     #define RidL_AboutDialogID    201
  14.  
  15.     //----------
  16.     CAboutDialog*
  17.     CAboutDialog::CreateAboutDialog(
  18.     LCommander    *inSuperCommander)
  19.     {
  20.          return ((CAboutDialog *)LWindow::CreateWindow(PPob_AboutDialogID, inSuperCommander));
  21.     }
  22.  
  23.     //----------
  24.     //    This is the function you register with URegistrar to create a
  25.     //    CAboutDialog from a resource
  26.     CAboutDialog*
  27.     CAboutDialog::CreateAboutDialogStream(
  28.     LStream    *inStream)
  29. {
  30.     return (new CAboutDialog(inStream));
  31. }
  32.  
  33. //----------
  34. //    The default constructor does nothing.
  35. CAboutDialog::CAboutDialog()
  36. {
  37. }
  38.  
  39. //----------
  40. //    The read-from-stream constructor just reads a dialog object.
  41. CAboutDialog::CAboutDialog(
  42.     LStream    *inStream)
  43.         : LDialogBox(inStream)
  44. {
  45. }
  46.  
  47. //----------
  48. //    The destructor does nothing.
  49. CAboutDialog::~CAboutDialog()
  50. {
  51. }
  52.  
  53. //----------
  54. //    This member function gets called once the containment hierarchy that contains
  55. //    this pane has been built. It gives us a chance to get data members for
  56. //    interesting subviews, and to do other operations now that our subviews exist.
  57. void
  58. CAboutDialog::FinishCreateSelf()
  59. {
  60.     LDialogBox::FinishCreateSelf();
  61.  
  62.     mOKButton = (LStdButton *)FindPaneByID('OK  ');
  63.  
  64.     UReanimator::LinkListenerToControls(this, this, RidL_AboutDialogID);
  65.         // the purpose is to "connect" self to whatever controls
  66.         // that we want to "listen" to
  67.  
  68. // any additional initialization for your dialog:
  69.  
  70. }
  71.  
  72. //----------
  73. void
  74. CAboutDialog::ListenToMessage(
  75.     MessageT    inMessage,
  76.     void        *ioParam)
  77. {
  78.     switch (inMessage) {
  79.     case msg_OK:
  80.                  GetSuperCommander()->ProcessCommand(cmd_AboutDialog, this);
  81.     break;
  82.  
  83.      case msg_Cancel:
  84.              DoClose();
  85.          break;
  86.     default:
  87.         break;
  88.     }
  89. }
  90.  
  91.  
  92. //----------
  93. Boolean
  94. CAboutDialog::ObeyCommand(
  95.     CommandT    inCommand,
  96.     void        *ioParam)
  97. {
  98.     Boolean        cmdHandled = true;
  99.  
  100.     switch (inCommand) {
  101.  
  102.     // +++ Add cases here for the commands you handle
  103.     //        Remember to add same cases to FindCommandStatus below
  104.     //        to enable/disable the commands
  105.  
  106.     default:
  107.             cmdHandled = LDialogBox::ObeyCommand(inCommand, ioParam);
  108.         break;
  109.     }
  110.  
  111.     return cmdHandled;
  112. }
  113.  
  114. //----------
  115. void
  116. CAboutDialog::FindCommandStatus(
  117.     CommandT    inCommand,
  118.     Boolean        &outEnabled,
  119.     Boolean        &outUsesMark,
  120.     Char16        &outMark,
  121.     Str255        outName)
  122. {
  123.     outUsesMark = false;
  124.  
  125.     switch (inCommand) {
  126.  
  127.     // +++ Add cases here for the commands you handle
  128.  
  129.     default:
  130.             LDialogBox::FindCommandStatus(inCommand, outEnabled,
  131.                                             outUsesMark, outMark, outName);
  132.         break;
  133.     }
  134. }
  135.  
  136. //----------
  137. Boolean
  138. CAboutDialog::FocusDraw()
  139. {
  140.     Boolean        focused = LView::FocusDraw();
  141.  
  142.     if (focused) {
  143.         AuxWinHandle    awHndl;
  144.         CTabHandle        awCTable;
  145.         ColorSpec        contentSpec;
  146.  
  147.         GetAuxWin(GetMacPort(), &awHndl);
  148.         awCTable = (**awHndl).awCTable;
  149.         contentSpec = (**awCTable).ctTable [wContentColor];        // should search vs. index
  150.         ::RGBBackColor(&contentSpec.rgb);
  151.     }
  152.  
  153.     return focused;
  154. }
  155.  
  156.